export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "模板编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "模板名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "createdBy",
          title: {
            "zh-CN": "创建人账号",
            "en-US": "created by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "createTime",
          title: {
            "zh-CN": "创建时间",
            "en-US": "create time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updatedBy",
          title: {
            "zh-CN": "修改人账号",
            "en-US": "updated by",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "updateTime",
          title: {
            "zh-CN": "修改时间",
            "en-US": "update time",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
      ];
    },
    // form中列字段
    formColumns() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "模板编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "模板名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "text" },
        },
        {
          key: "remark",
          title: {
            "zh-CN": "备注",
            "en-US": "remark",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          config: { type: "textarea" },
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "模板编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "模板名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "sf_code",
          title: {
            "zh-CN": "模板编码",
            "en-US": "sf_code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "sf_name",
          title: {
            "zh-CN": "模板名称",
            "en-US": "sf_name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    // 绑定选择项查询字段
    selectFormColumns () {
        return [
            {
                key: 'sf_code',
                title: {
                    'zh-CN': '质检项编码',
                    'en-US': 'sf_code'
                }[this.G_Locale],
                minWidth: 100,
                align: 'center'
            },
            {
                key: 'sf_name',
                title: {
                    'zh-CN': '质检项名称',
                    'en-US': 'sf_name'
                }[this.G_Locale],
                minWidth: 100,
                align: 'center'
            }
        ];
    },
    // 绑定选择项列字段
    selectColumns () {
        return [
            {
                key: 'sf_code',
                title: {
                    'zh-CN': '质检项编码',
                    'en-US': 'sf_code'
                }[this.G_Locale],
                minWidth: 100,
                align: 'center',
                show: true
            },
            {
                key: 'sf_name',
                title: {
                    'zh-CN': '质检项名称',
                    'en-US': 'sf_name'
                }[this.G_Locale],
                minWidth: 100,
                align: 'center',
                show: true
            }
        ];
    },
    // 绑定选择项列表更多字段
    selectMormColumns () {
        return {
            type: 'expand',
            slot: 'expand',
            width: 40,
            render: (h, params) => {
                return h('div', [
                    h('div', `${this.lang['remark']}:${params.row.remark}`)
                ])
            }
        }
    },
    lang () {
        return {
            'en-US': {
                cancel: 'cancel',
                confirmDelete: 'confirm delete?'
            },
            'zh-CN': {
                cancel: '取消',
                confirmDelete: '确认删除？'
            }
        }[this.G_Locale]
    },
  },
};
